using System.Linq.Expressions;
using Chengheng.Entity.Commodity;
using Microsoft.EntityFrameworkCore;

namespace Chengheng.Entity;

public class ChenghengDbContext : DbContext
{
    public ChenghengDbContext()
    {
    }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        optionsBuilder.UseSqlServer("""
                                    server=rm-bp1k5q6b27xe1lb585o.sqlserver.rds.aliyuncs.com,1433;
                                    user=fengliulin;
                                    password=QQwoaini123;
                                    database=ChenghengTestEFCore;
                                    TrustServerCertificate=True;
                                    """);
        // optionsBuilder.UseMySql("""
        //                         server=localhost;
        //                         port=3306;
        //                         user=root;
        //                         password=rootroot;
        //                         database=chengheng_test_efcore
        //                         """,
        //     ServerVersion.Parse("8.4.3-mysql"));
    }

    public virtual DbSet<Commodity.Commodity> Commodity { get; set; }

    public virtual DbSet<AuditEntry> AuditEntry { get; set; }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        

        CommodityConfiguration(modelBuilder);
    }

    private void CommodityConfiguration(ModelBuilder modelBuilder)
    {
    }
}